package com.definity.toolkit.ui.event;

import com.definity.toolkit.domain.Domain;
import com.definity.toolkit.persistence.RepositoryListener;
import com.definity.toolkit.ui.event.DomainEvent.DomainOperationType;

public class EventRepositoryListener implements RepositoryListener {

	@Override
	public void afterSave(Domain<?> domain) {
		EventDispatcher.getInstance().fire(new DomainEvent<Domain<?>>(domain, DomainOperationType.SAVE));
	}

	@Override
	public void afterDelete(Domain<?> domain) {
		EventDispatcher.getInstance().fire(new DomainEvent<Domain<?>>(domain, DomainOperationType.DELETE));
	}

}
